-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS: use shaderc-rs for glsl to spirv compilation #324
Conversation
21a5461
to
890cced
Compare
The biggest downsides here are that shaderc:
Medium term, Naga will handle this and wont suffer from these problems. Short term, I would only want to merge this if we do one of the following:
|
Makes sense, I prefer option 2 for now rather than making invasive changes to all platforms. |
890cced
to
3192405
Compare
I've updated to use cfg switches. However I noticed that @lachlansneff seems to have started on some naga support? https://github.com/bevyengine/bevy/commits/a47749c794761cc4c13879a1638a77cecaa06804/crates/bevy_render/src/shader/preprocessor.rs I thought I'd see if I could get naga working for iOS instead, and when I noticed that preprocessor support was lacking I stumbled across gfx-rs/naga#132 So maybe hold off on shaderc-rs, Naga would be better and doesn't have any of the iOS cmake issues since its pure rust. |
Naga is quickly becoming mature enough to replace spirv-reflect in bevy. |
I'm sold on waiting for Naga. That seems like the right call. But if you hit a roadblock / want to move forward now, im also willing to merge "shaderc but only for iOS" |
3192405
to
8e0cc40
Compare
Just rebased and re-pushed. I think we should just land this for now. We are getting some traction from multiple people on iOS support so let's land what we can to streamline the process. There's still one outstanding issue with |
Sounds good to me. I also just realized we could make this a temporary solution to #130 if we can somehow make shaderc optional for non-ios platforms and required for ios. But no sense in blocking on that. This is good to go. |
One of the steps to getting iOS working #87
I tested a few examples on mac
sprite
,sprite_sheet
, and3d_scene
. On iOS I tested3d_scene
and a cut down version ofspawner
.The motivating change for this was spawning glslValidator (or other processes) isn't going to work on iOS. Plus the
bevy-glsl-to-spirv
code said TODO use shaderc-rs.